﻿using System.ComponentModel.DataAnnotations;

namespace Rbac.Api.Dto;

public class CreatePermissionDto
{
    [Required(ErrorMessage = "权限名称不能为空")]
    [MaxLength(100, ErrorMessage = "权限名称长度不能超过 100 个字符")]
    public string Name { get; set; }

    [MaxLength(200, ErrorMessage = "权限描述长度不能超过 200 个字符")]
    public string Description { get; set; }
}


public class UpdatePermissionDto
{
    [Required(ErrorMessage = "权限ID不能为空")]
    public int Id { get; set; }

    [Required(ErrorMessage = "权限名称不能为空")]
    [MaxLength(100, ErrorMessage = "权限名称长度不能超过 100 个字符")]
    public string Name { get; set; }

    [MaxLength(200, ErrorMessage = "权限描述长度不能超过 200 个字符")]
    public string Description { get; set; }
}



// 用于返回权限信息的 DTO
public class PermissionDto
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public DateTime CreatedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }
}



